package com.atguigu.gmall.product.rpc;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.product.biz.CategoryBizService;
import com.atguigu.gmall.web.CategoryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author:ahang
 * @create:2022-10-03 20:46
 * @Description:
 */
//接口+内部调用+服务名
@RequestMapping("api/inner/product/")
@RestController
public class CategoryRpcController {

    @Autowired
    private CategoryBizService categoryBizService;

    @GetMapping("categorys/tree")
    public Result<List<CategoryVo>> getCategorys(){
        List<CategoryVo> tree = categoryBizService.getCategoryTree();
        return Result.ok(tree);
    }
}
